<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="./__/__.jsp"%>
<%@ include file="./__/ordersFunction.jsp"%>
<%@ include file="./__/comments.jsp"%>
<%@ include file="./__/commodity.jsp"%>
<%@ include file="./__/user.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>鞋城网站后台</title>
<script src="${pageContext.request.contextPath }/./scripts/SpryTabbedPanels.js" type="text/javascript"></script>
<link href="${pageContext.request.contextPath }/css/SpryTabbedPanels.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/./css/index_back.css"/>
<script type="text/javascript">

	$(function(){
		var str=${admin.permission.perid}; 
		 if(str==2){
				$('#2,#4,#5,#6,#7,#8,#10').attr('style','display:none');			
			}else if(str==4){
				$('#1,#3,#4,#5,#6,#8,#9,#10').attr('style','display:none');
			}else if(str==3){
				$('#2,#4,#5,#6,#7,#8,#9,#10').attr('style','display:none');		
			}

		/* 管理员 */
		$('#admins').on('click',function(){
			$('#tb').empty();
					$('#tt').empty();
					$('#tt').append('<h3><a onclick="li(this)">管理员账号</a></h3><ul><li>管理员列表</li><li><a>添加管理员</a></li>'
							+' </ul><h3>管理员权限</h3><ul>	<li><a>管理权限--权限列表</a></li><li><a>管理权限--新增权限</a></li></ul>');
				$('#dg').datagrid({    				
				
				    url:'<%=request.getContextPath() %>/admin/FindByPage.do',  
				    pagination:true,
				    pageSize:5,
				    pageNumber:1,
				    pageList: [5,10,20,50],
				    fitColumns:true,
				    toolbar:'#tb2',
				    columns:[[    
				        {field:'operate',checkbox:true},   
				        {field:'aid',title:'编号',width:100,align:'center'},
						{field:'acount',title:'管理员账号',width:100,align:'center'},
				        {field:'apwd',title:'密码',width:100,align:'center'}, 
				        {field:'tt',title:'处理',width:100,
				        	formatter: function(value,row,index){
								return '<a href="#" onclick="updateByUser('+row.aid+')">更新</a>&nbsp;&nbsp;<a href="">删除</a>';
				        	},align:'center'},
				    ]]    
				});  
		});
	});
	
	function updateByUser(aid){
		$.post('<%=request.getContextPath() %>/admin/FindByaid.do',{aid:aid},function(date){
			$('#fm').form('load',date)	
		})
		$('#dlg1').dialog('open').dialog('center').dialog('setTitle','新增产品');
	}

	function operate(){
		$('#fm').form('submit',{    
		    url:'<%=request.getContextPath()%>/admin/UpdateAdmins.do', 		
		    success:function(data){    
		    	$.messager.alert('警告',data);  
		    	$('#dlg').dialog('close');
		    }    
		}); 
		
	}
</script>
</head>
<body class="easyui-layout">   
    <div data-options="region:'north',title:'网上鞋城',split:true" style="height:110px;">
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
	  	<tr>
		    <td style="height:45px; background:url(${pageContext.request.contextPath }/images/b_top.gif);">  
		    	<div style="width:326px; height:49px; position:absolute; margin-top:-18px; margin-left:10px;">
		   			<img width="326px;" height="49px;" src="<%=request.getContextPath() %>/login_files/website_logo.gif"/>
		    	</div>	
		    </td>
	 	 </tr>
  		 <tr>
		    <td>    
		    <div style="width:100%; height:17px; position:absolute; padding-top:0px; font-size:12px;">
		   		<span style="margin-left:10px">
		   		${admin.permission.pername}:  		  
		       ${acount}欢迎登录，&nbsp;|&nbsp;<a href="<%=request.getContextPath() %>/login.jsp"><font style="color: #F00;font-weight: bold;">安全退出</font></a>
		        </span>
		    </div>
		    </td>
		    
		    <td>
		    <!-- 后台主界面卡片选项 -->
			<div id="TabbedPanels1" class="TabbedPanels">
		  		<ul class="TabbedPanelsTabGroup">
		  		
		               <li class="TabbedPanelsTab" id="1"><a>交易报表</a></li>
		  		
		               <li class="TabbedPanelsTab" id="2"><a>企宣设置</a></li>
		  		
		               <li class="TabbedPanelsTab" id="3"><a id="commdity">商品管理</a></li>
		  		
		               <li class="TabbedPanelsTab" id="4"><a>物流合作</a></li>
		  		
		               <li class="TabbedPanelsTab" id="5"><a id="userInfo">用户管理</a></li>
		  		
		               <li class="TabbedPanelsTab" id="6"><a>积分管理</a></li>
		  		
		               <li class="TabbedPanelsTab" id="7"><a>站内信息</a></li>
		  		
		               <li class="TabbedPanelsTab" id="8"><a id="admins">管理员账号</a></li>
		  		
		               <li class="TabbedPanelsTab" id="9"><a id="orders">订单管理</a></li>
		  		
		               <li class="TabbedPanelsTab" id="10"><a onclick="selectcomments()" id="comments">评价管理</a></li>
		  		
		  			</ul>
		  		</div>
        		</td>
        	</tr>
       </table>
    </div>   
    <div data-options="region:'west',title:'导航菜单',split:true" style="width:200px;">
    	<div id="tt"></div>
    </div>   
    <div data-options="region:'south',title:'更多功能',split:true" style="height:100px;"></div>   
    <div data-options="region:'center',title:'详细内容'" style="padding:5px;background:#eee;">
    	<div id="dg"></div> 
    	<div id="dg001"></div>  
	    	<div id="dlg1" class="easyui-dialog" style="width:700px" closed="true" buttons="#dlg-button">
				 <form id="fm" method="post" style="margin:0;padding:20px 50px">
	            <table>
	            	<tr>
	            		<td>编号:</td>
	            		<td><input name="aid" class="easyui-textbox" data-options="iconCls:'icon-search',prompt:'aaaa'" style="width:200px"></td>
	            	</tr>
	            	<tr>
	            		<td>管理员账户:</td>
	            		<td>
	            			<input name="acount" class="easyui-textbox" style="width:200px;"/>
	            		</td>
	            	</tr>
	            	<tr>
	            		<td>密码</td>
	            		<td><input name="apwd" class="easyui-textbox" style="width:200px;"/>
	            	</tr>
	            	<tr>
	            		<td>管理员权限</td>
	            		<td><input name="aremarks" class="easyui-textbox" style="width:200px;"/></td>
	            	</tr>
	            	
	            </table>
	        </form>
	    </div>
	     <div id="dlg-button">
	        <a href="javascript:void(0)" id="operate" class="easyui-linkbutton c6" iconCls="icon-ok" onclick="operate()" style="width:90px">保存</a>
	        <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#dlg').dialog('close')" style="width:90px">取消</a>
	    </div> 
	    <div id="dlg" class="easyui-dialog" style="width:700px" closed="true">
    	<div id="dg002"></div>
    </div>
	<div id="tb" align="right"></div>
</div>
<div id="updateUser" class="easyui-dialog" style="width:700px" closed="true" buttons="#dlg-buttons">
      <form id="ufm" method="post" style="margin:0;padding:20px 50px">
			<input type="hidden" name="uid">            
            <table>           	
            	<tr>
            		<td>账号:</td>
            		<td>
            			<input name="uaccount" class="easyui-textbox" style="width:200px;" readonly="readonly"/>
            		</td>
            	</tr>
            	<tr>
            		<td>密码：</td>
            		<td>
            			<input name="upwd" class="easyui-textbox" style="width:200px;"/>
            		</td>
            	</tr>
            	<tr>
            		<td>姓名：</td>
            		<td>
            			<input name="uname" class="easyui-textbox" style="width:200px;"/>
            		</td>
            	</tr>
            	<tr>
            		<td>电话：</td>
            		<td>
            			<input name="utel" class="easyui-textbox" style="width:200px;"/>
            		</td>
            	</tr>            	
            	<tr>
            		<td>性别：</td>
            		<td><input type="radio" name="ugender" value="男">男<input type="radio" name="ugender" value="女">女</td>
            	</tr>
            	<tr>
            		<td>积分：</td>
            		<td><input name="uintegral" class="easyui-textbox"></td>
            	</tr>
            	<tr>
            		<td>邮箱：</td>
            		<td><input name="uemail" class="easyui-textbox"></td>
            	</tr>
            	<tr>
            		<td>注册时间：</td>
            		<td>
            			<input name="uregtime" class="easyui-datetimebox">
            		</td>           		
            	</tr>
            	<tr>
            		<td colspan="2" align="center">
            			<input type="button"  value="修改" onclick="test1()"> <input type="reset" value="清空">
            		</td>           		
            	</tr>
            </table>
        </form>
    </div>  
</body>
</html>